# -*- coding:utf-8 -*-

"""
version:1.00.01
change: 2010-09-07 修改函数名
"""

import sys

def print_red_line(msg):
    """
    @summary: 输出信息，颜色为红色，自动换行
    @param msg: 信息内容
    """
    print "\033[31;2m%s\033[0m" %(msg)
    
def print_green_line(msg):
    """
    @summary: 输出信息，颜色为绿色，自动换行
    @param msg: 信息内容
    """
    print "\033[32;2m%s\033[0m" %(msg)
        
def print_yellow_line(msg):
    """
    @summary: 输出信息，颜色为黄色，自动换行
    @param msg: 信息内容
    """
    print "\033[33;2m%s\033[0m" %(msg)
    
def print_white_line(msg):
    """
    @summary: 输出信息，颜色为白色，自动换行
    @param msg: 信息内容
    """
    print msg
        
def print_red(msg):
    """
    @summary: 输出信息，颜色为红色
    @param msg: 信息内容
    """
    sys.stdout.write("\033[31;2m%s\033[0m"%(msg))
        
def print_green(msg):
    """
    @summary: 输出信息，颜色为绿色
    @param msg: 信息内容
    """
    sys.stdout.write("\033[32;2m%s\033[0m"%(msg))
    
def print_yellow(msg):
    """
    @summary: 输出信息，颜色为黄色
    @param msg: 信息内容
    """
    sys.stdout.write("\033[33;2m%s\033[0m"%(msg))
    
def print_white(msg):
    """
    @summary: 输出信息，颜色为白色
    @param msg: 信息内容    
    """
    sys.stdout.write(msg)
    
def print_info(msg):
    """
    @summary: 输出提示，颜色默认，补齐59个字符
    @param msg: 提示内容
    """
    sys.stdout.write(msg.ljust(59))
       
def print_ok_line():
    """
    @summary: 输出提示，颜色为绿色，补齐6个字符
    """
    sys.stdout.write("[\033[32;2m%s\033[0m]\n"%("OK".center(6)))                          

def print_error_line():
    """
    @summary: 输出提示，颜色为红色，补齐6个字符
    """
    sys.stdout.write("[\033[31;2m%s\033[0m]\n"%("FAILED".center(6)))
    
def print_exist_line():
    """
    @summary: 输出提示，颜色为红色，补齐6个字符
    """
    sys.stdout.write("[\033[32;2m%s\033[0m]\n"%("EXIST".center(6)))
    